#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
int* productExceptSelf(int* nums, int numsSize, int* returnSize) 
{
    int* answer = (int*)malloc(sizeof(int) * numsSize);
    int* left = (int*)malloc(sizeof(int) * numsSize);
    int* right = (int*)malloc(sizeof(int) * numsSize);
    int i = 0;
    left[0] = 1;
    right[0] = 1;
    for (i = 1; i < numsSize; i++)
    {
        left[i] = nums[i - 1] * left[i - 1];
    }
    for (i = 1; i < numsSize; i++)
    {
        right[i] = nums[numsSize - i] * right[i - 1];
    }
    for (i = 0; i < numsSize; i++)
    {
        answer[i] = left[i] * right[numsSize - 1 - i];
    }
    *returnSize = numsSize;
    return answer;
}

int main()
{
    int len = 0;
    int retsize = 0;
    int i = 0;
    scanf("%d", &len);
    int* arr = (int*)malloc(sizeof(int) * len);
    for (i = 0; i < len; i++)
    {
        scanf("%d", &arr[i]);
    }
    int* ret = productExceptSelf(arr, len, &retsize);
    for (i = 0; i < retsize; i++)
    {
        printf("%d ", *(ret + i));
    }
    return 0;
}